<!DOCTYPE html>
<html lang="en">
<head>
    <!-- 使用css动画实现小球的自由落体 -->
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0;
            padding: 0;;
        }
        #main{
            height: 900px;
            background-color: wheat;
            border-bottom: 2px solid black;
            overflow: hidden;
        }
        #main > div{
            width: 100px;
            height: 100px;
            border-radius: 50%;
            animation: ball 1s forwards;
            animation-iteration-count: 5;
        }
        #box1{
            background-color: yellowgreen;
        }

        @keyframes ball{

            from{
                margin-top: 0;
                animation-timing-function: ease-in;
            }
            33.3%{
                margin-top: 800px;
                /* 减速 */
                animation-timing-function: ease-out;
            }
            66.7%{
                margin-top: 400px;
                animation-timing-function: ease-in;
            }
            to{
                margin-top: 800px;
            }
        }
    </style>
</head>
<body>
    <div id="main">
        <div id="box1"></div>
    </div>
</body>
</html>